<?php
include "inc/database_functions.inc.php";

$cat_id = $_GET["category_id"];
$query_string = sprintf('SELECT com_id FROM category_item WHERE cat_id = %d', $cat_id);
$rs = query($query_string);

while ($com_id_row = mysql_fetch_object($rs)) {
  $query_string2 = sprintf("SELECT com_name, com_price FROM commodity WHERE com_id = %d", $com_id_row->com_id);
  $rs2 = query($query_string2);
  while ($com_row = mysql_fetch_object($rs2))
    {
      echo $com_row->com_name;
      echo $com_row->com_price;
    }
}

disconnect();
?>
